package com.wjb.xietong.ota;

import com.wjb.xietong.R;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class CrmSalesDetail extends BaseOTA{

	private WebView webView = null; 
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentField(getLayoutInflater().inflate(R.layout.crm_wv_sales,
				null));
		
		setTopBarAndAction(getResources().getString(R.string.crm_sales_detail),
				new OnClickListener() {

					@Override
					public void onClick(View v) {
						app_.getActManager().popActivity();
					}
				}, null);

		
		String url = getIntent().getStringExtra("url");
		
		webView = (WebView) findViewById(R.id.idWVSalesInfo);  
		webView.getSettings().setJavaScriptEnabled(true);
		webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
		webView.setScrollbarFadingEnabled(true);
		webView.setWebViewClient(new crmWebClient());
		webView.setWebChromeClient(m_chromeClient);
		webView.loadUrl(url);
	}
	
	public class crmWebClient extends WebViewClient {
	    @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            // TODO Auto-generated method stub
            view.loadUrl(url);
            return true;
        }
	    @Override
		public void onPageFinished(WebView view, String url) {
	    	// TODO
	    }

	}
	
	
	private WebChromeClient m_chromeClient = new WebChromeClient(){
		   @Override
		   public void onShowCustomView(View view, CustomViewCallback callback) {
		       // TODO Auto-generated method stub
		   }    
		};
	
}
